import request from '@/utils/request'

// 查询健康报告列表
export function listHealthReport(query) {
  return request({
    url: '/health/healthReport/list',
    method: 'get',
    params: query
  })
}

// 查询健康报告详细
export function getHealthReport(id) {
  return request({
    url: '/health/healthReport/' + id,
    method: 'get'
  })
}

// 查询健康报告详细
export function getDetail(id) {
  return request({
    url: '/health/healthReport/getDetail/' + id,
    method: 'get'
  })
}

export function getReportUrl(id) {
  return request({
    url: '/health/healthAnalysis/getReportUrl/' + id,
    method: 'get'
  })
}

export function getZkxcReport(id) {
  return request({
    url: '/health/healthAnalysis/getZkxcReport/' + id,
    method: 'get'
  })
}
export function getLastReportInfo(id) {
  return request({
    url: '/health/healthReport/getLastReportInfo/' + id,
    method: 'get'
  })
}

// 新增健康报告
export function addHealthReport(data) {
  return request({
    url: '/health/healthReport',
    method: 'post',
    data: data
  })
}

// 新增健康报告
export function glossoscopy(data) {
  return request({
    url: '/health/healthReport/glossoscopy',
    method: 'post',
    data: data
  })
}

// 修改健康报告
export function updateHealthReport(data) {
  return request({
    url: '/health/healthReport',
    method: 'put',
    data: data
  })
}

// 删除健康报告
export function delHealthReport(id) {
  return request({
    url: '/health/healthReport/' + id,
    method: 'delete'
  })
}

export function getReportStatistics(customerId,reportType,params) {
  return request({
    url: `/health/healthReportStatistics/full/${customerId}/${reportType}`,
    method: 'get',
    params: params
  })
}


// 获取可用报告周期
export function getAvailablePeriods(customerId, reportType) {
  return request({
    url: `/health/healthReportStatistics/periods/${customerId}/${reportType}`,
    method: 'get'
  })
}

// 获取可用报告周期
export function getTimeBaseData(customerId, reportType, params) {
  return request({
    url: `/health/healthReportStatistics/getTimeBaseData/${customerId}/${reportType}`,
    method: 'get',
    params:params
  })
}
